home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19970929-19971216 / 000342_news@newsmaster….columbia.edu _Sat Dec 6 11:16:04 1997.msg < prev    next >
Internet Message Format  |  2020-01-01  |  7KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA09956
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sat, 6 Dec 1997 11:16:04 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA01728
  7.     for kermit.misc@watsun; Sat, 6 Dec 1997 11:16:03 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: set host name service broke 5A(190) to 6.0.192
  12. Date: 6 Dec 1997 16:16:02 GMT
  13. Organization: Columbia University
  14. Lines: 115
  15. Message-ID: <66bto2$eff$1@apakabar.cc.columbia.edu>
  16. References: <669ptm$7c3$1@post.servtech.com>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Keywords: host telnet port service expect
  19. Xref: news.columbia.edu comp.protocols.kermit.misc:8137
  20.  
  21. In article <669ptm$7c3$1@post.servtech.com>,
  22. Dr. R. Chandra <rchandra@letter.com> wrote:
  23. : I used to use "set host name service" in 5A(190), primarily in the
  24. : following incantation:
  25. :     set host smtp.servtech.com smtp
  26. : After building 6.0.192 and running the same script, the "service" part
  27. : would always get forced to telnet.  This, of course, broke things in a
  28. : big way.  Here may be some relevant configuration data:
  29. : C-Kermit 6.0.192, 6 Sep 96, for Linux
  30. : ...
  31. :
  32. This has never been reported before.  Locally, connections of the form "set
  33. host xxx smtp" work just fine, except to the host you have named above.
  34. However, experimentation shows that even when this fails, it tends to work if
  35. you make a different connection first, then close it, then try again to make
  36. the connection that didn't work before.
  37.  
  38. : I hacked around this to get it to work, basically by creating my own
  39. : global variable called tcpsvc...
  40. :
  41. I'm not sure there was a problem there.  Debug logs show that C-Kermit does
  42. not show any symptoms of forgetting about the service.  Comparison of the
  43. 6.0 netopen() source code and the 6.1 code (currently in development, which
  44. works) shows a few subtle differences which evidently do the trick.  Of
  45. course, anything is possible - but if there were a flagrant error, we
  46. certainly would have heard about it before now.
  47.  
  48. In any case, we'll give the code a close look.
  49.  
  50. : BTW, I doubt this is related, but just in the interest of full
  51. : disclosure: I made some other mods to the code to enable me to use
  52. : Kermit as the dialer for PPP (pppd).  This involved a few changes,
  53. : mainly to ckutio.c.  I set up a global flag which is initialized to
  54. : false, and only gets set to true by encountering EXIT or QUIT.  In the
  55. : ttclos() routine, if this flag is not set, it returns without setting
  56. : the speed to B0 (which would hang up...not particularly useful when
  57. : PPP negotiations are in progress).
  58. :
  59. Well...  Setting the speed to B0 is only one of many ways of hanging up.
  60. Other ways include sending the hangup string to the modem, dropping DTR, etc,
  61. and C-Kermit will do whatever is appropriate based on the platform, various
  62. settings, etc.  In UNIX, isn't it true that when a process exits, all of the
  63. files it opened are automatically closed?  And in that case, doesn't closing
  64. of a terminal device usually involve dropping DTR, which, when a modem is
  65. configured normally, causes it to hang up the phone?
  66.  
  67. : Thus, the line only gets hung up
  68. : by "other forces" (such as the HUPCL bit :^).  Additionally, the
  69. : programs (scripts) that run when the IP layer goes up and the modem is
  70. : to be hung up (ip-up script/program and "disconnect <program/script>"
  71. : argument) manage the lockfiles, which enables cooperation between
  72. : Kermit and pppd.  Lastly, if Kermit discovers that the number in the
  73. : lockfile is not its own PID, it prints a warning and does not attempt
  74. : to remove (unlink(2)) the lockfile(s).
  75. Lots of people want to make C-Kermit do their PPP or SLIP dialing, for
  76. good reasons.  But there is a better way to do it.  Instead of having
  77. Kermit open the terminal device, pass it the file descriptor of an already-
  78. open device (this fits your description); then it won't try to open it or
  79. to close it, and therefore it won't hang it up.  There is an entry in the
  80. (newly updated) Kermit FAQ about this:
  81.  
  82. 27 HOW CAN I EXIT FROM C-KERMIT WITHOUT HANGING UP?
  83.  
  84. Many people want to be able to make a dialout connection with UNIX C-Kermit,
  85. but then use some other software on the connection that C-Kermit made.  For
  86. example, they want to use C-Kermit as their SLIP or PPP dialer.  But they
  87. quickly find that when they exit from C-Kermit, that the connection is gone
  88. before they can start the other application.
  89.  
  90. It is a fundamental property of UNIX (and VMS, and Windows 95 and NT, and most
  91. other modern operating systems) that when a process exits, then every file that
  92. was opened by that process is automatically closed by the operating system.  In
  93. most cases, closing a terminal device (such as a dialout serial port) hangs up
  94. the modem (by turning off the DTR signal).  There is nothing the process can do
  95. about it.
  96.  
  97. However, many workarounds are possible.  Here are just a few:
  98.  
  99.    - If your C-Kermit version supports the REDIRECT command, use it to
  100.      start the desired application (e.g. "redirect pppd").  The REDIRECT
  101.      command runs the given application with its standard input and output
  102.      redirected to the communications channel opened by C-Kermit's most
  103.      recent SET LINE or SET HOST command.
  104.  
  105.    - Tell C-Kermit to SET MODEM HANGUP-METHOD RS232, and then configure
  106.      your modem to ignore DTR (not recommended).  "Using C-Kermit", 2nd
  107.      Ed., p.86.
  108.  
  109.    - When opening the device first from another application, feed the file
  110.      descriptor for the device to C-Kermit using the "-l" (lowercase
  111.      letter L) command-line option followed by the numeric file
  112.      descriptor, e.g.  "kermit -l 6".  Then Kermit will not attempt to
  113.      open the device, nor to change its characteristics, nor to close it
  114.      when done, and when Kermit exits, it will still be available to the
  115.      invoking process.  "Using C-Kermit", 2nd Ed., p.469.
  116.  
  117.    - When opening the device with C-Kermit, find out the file descriptor
  118.      of the open device (it is given by C-Kermit's \v(ttyfd) variable) and
  119.      then run ("!")  your other program from the C-Kermit prompt, feeding
  120.      it the file descriptor, e.g. through shell redirection or a command
  121.      line option (the method depends on the other program, the
  122.      capabilities of the shell, etc).  "Using C-Kermit", 2nd Ed., p.356
  123.  
  124.    - In UNIX, after Kermit makes the connection, type "show comm" to find
  125.      out the filename of the lock file.  Then suspend Kermit, delete the
  126.      lock file, then start the other program and tell it to open the same
  127.      tty device.
  128.  
  129. Thanks for the report.
  130.  
  131. - Frank